package com.libertyville.domain.orgmng;

import java.util.stream.Stream;

public enum OrgTypeStatus {
    EFFECTIVE("Ef"),
    TERMINATED("Te");

    private final String code;

    OrgTypeStatus(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public static OrgTypeStatus find(String code) {
        return Stream.of(OrgTypeStatus.values())
                .filter(it -> it.getCode().equals(code))
                .findFirst()
                .orElseThrow(IllegalArgumentException::new);
    }


}
